import{User} from '../models/User';
import{Token} from '../models/Token';
import{Project} from '../models/Project';
import{BaseService} from './BaseService';
import{ProjectsDao} from '../dao/ProjectsDao';
export class ProjectsService extends BaseService
{
  projectsDao:ProjectsDao;
  constructor()
  {
    super();
    this.projectsDao = new ProjectsDao();
  }

  add(project:Project,callback:Function)
  {
    this.projectsDao.add(project,callback);
  }

  getProject(projectId:string,callback:Function)
  {
    this.projectsDao.get(projectId,callback);
  }

  getProjects(callback:Function)
  {
    this.projectsDao.gets(callback);
  }

  getMyProjects(userId,callback:Function)
  {
    this.projectsDao.getMines(userId,callback);
  }

  updateProject(project:Project,callback:Function)
  {
    this.projectsDao.update(project,callback);
  }

  deleteProject(projectId:string,callback:Function)
  {
    this.projectsDao.delete(projectId,callback);
  }
}
